# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.shortcuts import render
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
import json
from users.models import User

# Create your views here.
def index(request):
	return render(request,'main/base.html')
@csrf_exempt
def accounts_profile(request):
	if request.method == 'POST':
		a = json.loads(request.body)
		print(a)
		b = User.objects.get(email=request.user.email)
		b.name = a['name']
		b.save()
	return render(request,'main/accounts_profile.html')